<?php
defined('BASEPATH') OR exit('No direct script access allowed');


use QCloud_WeApp_SDK\Mysql\Mysql as DB;


class AddressDelete extends CI_Controller
{
    public function index()
    {
        $id = $_GET['id'];
        $rows = null;
        if ($id) {
            $rows = DB::delete('cc_address', ['id' => $id]);
        }

        if ($rows > 0) {
            $this->json([
                'code' => 0,
                'data' => $rows
            ]);
        } else {
            $this->json([
                'code' => -1,
                'error' => $rows['error']
            ]);
        }
    }
}
